/**
 * 页面
 */
<template>
	<view>
		<u-card :title="item.projectName" :sub-title="item.createTime+' '+item.implementationStatus_dictText" v-for="(item,index) in taskList" :key="index" @click="gotoDetail(item)">
			<view class="" slot="body">
				<view>
					<view class="u-font-25">
						<view class="u-body-item-title u-line-2">{{item.implementContractId_dictText || '无'}}</view>
					</view>
				</view>
			</view>
		</u-card>
	</view>
</template>

<script>
	// 引入封装好的网络请求
	import xiangmuApi from "../../api/xiangmu.js"
	import {
	  http
	} from '@/common/service.js'
	export default {
		mounted() {
			this.token = this.$store.state.token
			this.getTaskList()
		},
		data() {
			return {
				// 搜索框双向绑定
				keyword: '',
				// tab栏列表
				
				token: '',
				// 审核列表
				taskList: [],
				current: 0,
				title: '素胚勾勒出青花，笔锋浓转淡',
				subTitle: '2020-05-15',
				thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
			}
		},
		methods: {
			getTaskList() {
				xiangmuApi.getXiangMuList({
					'X-Access-Token': this.$store.state.token
				}).then(res => {
					console.log(res)
					console.log('用户个人',this.$store.state.userInfo)
					this.taskList = res.data.result.records
				})		
			},
			change(index) {
				this.current = index; 
				this.getTaskList()
			},
			// 跳转到详情页面的回调函数
			gotoDetail(item) {
				this.$Router.push({ path: '/pages/xiangmuDetail/xiangmuDetail', query: { obj: item, current: this.current}})
			}
		}
	}
</script>

<style lang="scss">
	.u-card-wrap { 
		background-color: $u-bg-color;
		padding: 1px;
	}
	
	.u-body-item {
		font-size: 32rpx;
		color: #333;
		padding: 20rpx 10rpx;
	}
		
	.u-body-item image {
		width: 120rpx;
		flex: 0 0 120rpx;
		height: 120rpx;
		border-radius: 8rpx;
		margin-left: 12rpx;
	}
</style>